﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Phone_Client.Commands_Utils;

namespace Phone_Client.ViewModels
{
    public class ManagementPageItemVM : IViewModelBase
    {
        #region Fields

        private String      _title, _category;
        private ICommand    _updatecmd;
        private bool        _isitemselected;

        #endregion

        #region Properties

        public String Title 
        {
            get { return _title; }
            set
            {
                if (_title == value) return;
                _title = value;
                RaisePropertyChanged("Title");
            }
        }

        public String Category
        {
            get { return _category; }
            set
            {
                if (_category == value) return;
                _category = value;
                RaisePropertyChanged("Category");
            }
        }
        public bool IsItemSelected
        {
            get { return _isitemselected; }
            set
            {
                if (_isitemselected == value) return;
                _isitemselected = value;
                RaisePropertyChanged("IsItemSelected");
            }
        }
        #endregion

        #region Commands

        public ICommand UpdateCmd
        {
            get { return _updatecmd; }
        }

        #endregion

        #region Commands Functions

        public void UpdateFunc()
        { }

        #endregion

        #region Functions

        #endregion

        #region Ctor

        public ManagementPageItemVM(String title, String category)
        {
            if (!String.IsNullOrWhiteSpace(title) && !String.IsNullOrWhiteSpace(category))
            {
                _title = title;
                _category = category;
                _updatecmd = new RelayCommand(UpdateFunc) { IsEnabled = true };
                _isitemselected = false;
            }
        }

        #endregion
    }
}
